<%@ page import="com.xlro.service.BookService" %>
<%@ page import="com.xlro.service.UserService" %>
<%@ page import="com.xlro.domain.BrowseBook" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="com.xlro.domain.BorrowBooks" %>
<%@ page import="com.xlro.domain.Book" %>
<%@ page import="com.xlro.util.MyDate" %>
<%--
  Created by IntelliJ IDEA.
  User: xlro
  Date: 2021/4/22
  Time: 16:20
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>借阅情况</title>
    <link rel="stylesheet" href="layui/css/layui.css" media="all">
    <link rel="stylesheet" type="text/css" href="jQuery/css/htmleaf-demo.css">
    <link rel="stylesheet" href="jQuery/css/style.css"/>
    <style>
        #top-image {
            background: linear-gradient(
                    rgba(0, 0, 0, 0.2),
                    rgba(0, 0, 0, 0.2)
            ), url('jQuery/images/1.jpg') no-repeat fixed;
            position:fixed ;
            top:0;
            width:100%;
            z-index:0;
            height:100%;
        }


        html, body {
            font-size: 14px;
            width: 100%;
            height: 100%;
            color: #fff;
        }
        input{
            color: #fff!important;
        }
        input::-webkit-input-placeholder{
            color: #fff!important;
        }

        .login-layout {
            position: absolute;
            width: 500px;
            left: 50%;
            top: 50%;
            border-radius: .75rem;
            transform: translate(-50%, -50%);
            background: rgba(255,255,255, 0.1);
            padding: 100px 80px 80px 50px;
            backdrop-filter: blur(10px);
            display: flex;
            justify-content: center;

        }

    </style>
</head>
<body style="width: 100%">

<div id="top-image" style="width: 100%">
    <div class="login" style="width: 100%">
        <div class="login-layout" style="width: 90%">

            <%
                String username = (String) session.getAttribute("username");
                BookService bs = new BookService();
                ArrayList<BorrowBooks> borrowBooks = bs.getBorrowBook(new UserService().getUser(username).getId()); %>
            <hr>


            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;width:50%">
                <legend>
                    已经借阅 <%=borrowBooks.size()%>本
                </legend>
            </fieldset>

            <br>
            <%
                for (BorrowBooks b :
                        borrowBooks) {
                    Book book = new BookService().getBook(b.getBookId());%>


            <div class="layui-collapse" lay-accordion>
                <div class="layui-colla-item">
                    <h2 class="layui-colla-title"><% out.println("《"+book.getName()+"》"); %></h2>
                    <div class="layui-colla-content layui-show">

                        <%
                            out.println("<p>"+MyDate.isReturn(book.getName(),MyDate.getThis(),b.getEndDate())+"</p>"); %>

                    </div>
                </div>

            </div>


                <%}%>


        </div>
    </div>
</div>



        <script src="layui/layui.js"></script>
        <script src="jQuery/js/jquery-1.11.0.min.js"></script>
        <script src="jQuery/js/ios-parallax.js"></script>


        <script>
            layui.use('layer', function(){
                var layer = layui.layer;

                layer.config({
                    skin: 'demo-class'
                })

            });


        </script>

        <script type="text/javascript">
            $(document).ready(function() {
                $('#top-image').iosParallax({
                    movementFactor: 500,
                    dampenFactor: 100
                });
            });
        </script>
</body>
</html>